﻿using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace YogaStudio.Data.Domain
{
    public class Product
    {
        [Key]
        public int ProductId { get; set; }

        [ForeignKey("Category")]
        [Required]
        public int CategoryId { get; set; }

        [Required]
        [DisplayName("Product Name")]
        public string ProductName { get; set; }

        [Required]
        [DataType(DataType.MultilineText)]
        public string Description { get; set; }

        [DisplayName("Search Attributes")]
        public string SearchAttributes { get; set; }

        [DisplayName("Image Url")]
        public string ImageUrl { get; set; }
        
        [Required]
        public decimal Price { get; set; }

        [DisplayName("Is Available")]
        public bool IsAvailable { get; set; }

        public virtual Category Category { get; set; }
        public virtual ICollection<OrderItem> OrderItems { get; set; }
        public virtual ICollection<ShoppingCart> ShoppingCarts { get; set; } 
    }
}
